<?php
/**
 * Класс отображения информации для раздела Order
 *
 */
class  View_Order {
  

  /**
  * Метод выводит форму заказа ( Order )
  *
  * @param object $objOrder
  */	
  public static function showForm($objOrder) {
  	$objForm = new Form_ViewForm(array('errorIfExists' => true, 'successMessage' => 'Заказ принят', 'leftWidth' => 200, 'action' => 'https://merchant.w1.ru/checkout/default.aspx',), $objOrder);
		$objForm->show();  	
		
  	$arrSubmitButton = array('value' => 'Send_order', 'src' => W_IMAGES . 'button/send_order.gif', 'class' => 'sendOrderButton', 'show_on_left' => true);		
    $objForm->submitButton($arrSubmitButton, 'send_order');
  	
    echo '<form method="post" action="https://merchant.w1.ru/checkout/default.aspx" accept-charset="UTF-8">
      <input name="WMI_MERCHANT_ID" type="hidden" value="'.$objOrder->getField('WMI_MERCHANT_ID').'"/><br/>

      <input name="WMI_PAYMENT_AMOUNT" type="hidden" value="'.$objOrder->getField('test').'"/><br />

      <input name="WMI_CURRENCY_ID" type="hidden" value="'.$objOrder->getField('WMI_CURRENCY_ID').'"/><br />
      
      <input name="WMI_DESCRIPTION" type="hidden" value="'.$objOrder->getField('WMI_DESCRIPTION').'"/><br />
      
      <input name="WMI_SUCCESS_URL" type="hidden" value="'.W_FULLPATH . '"myorder/?success=1"/><br />
      
      <input name="WMI_FAIL_URL" type="hidden" value="'.W_FULLPATH . '"myorder/?error=1"/><br /><br />
      
    </form>';
    $objForm->close();	    
  }

}



